//
//  WorkPlanCell.m
//  PASystem
//
//  Created by 刘沿 on 16/9/19.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "WorkPlanCell.h"

@implementation WorkPlanCell

+(instancetype)WithWorkPlanCell{

    return [[[NSBundle mainBundle] loadNibNamed:@"WorkPlanCell" owner:nil options:nil] lastObject];
}

- (void)setModel:(WorkModel *)model{
    _model = model;

    self.TITLE.text = model.TITLE;
    self.EDITMAN.text = model.EDITMAN;
    //时间戳转时间
    NSString *string = model.EDITTIME;
    NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
    fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
    NSDate *date = [fmt dateFromString:string];
    NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
    NSString *selfYear = [fm stringFromDate:date];

    self.EDITTIME.text = selfYear;
}


@end
